Integrand size = 39, antiderivative size = 121 \[ \int \cos (c+d x) (a+a \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=a^2 (2 A+B) x+\frac {a^2 (2 A+4 B+3 C) \text {arctanh}(\sin (c+d x))}{2 d}+\frac {A (a+a \sec (c+d x))^2 \sin (c+d x)}{d}-\frac {a^2 (2 A-2 B-3 C) \tan (c+d x)}{2 d}-\frac {(2 A-C) \left (a^2+a^2 \sec (c+d x)\right ) \tan (c+d x)}{2 d} \]
a^2*(2*A+B)*x+1/2*a^2*(2*A+4*B+3*C)*arctanh(sin(d*x+c))/d+A*(a+a*sec(d*x+c ))^2*sin(d*x+c)/d-1/2*a^2*(2*A-2*B-3*C)*tan(d*x+c)/d-1/2*(2*A-C)*(a^2+a^2* sec(d*x+c))*tan(d*x+c)/d
Time = 2.17 (sec) , antiderivative size = 129, normalized size of antiderivative = 1.07 \[ \int \cos (c+d x) (a+a \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=2 a^2 A x+a^2 B x+\frac {a^2 A \text {arctanh}(\sin (c+d x))}{d}+\frac {2 a^2 B \text {arctanh}(\sin (c+d x))}{d}+\frac {3 a^2 C \text {arctanh}(\sin (c+d x))}{2 d}+\frac {a^2 A \sin (c+d x)}{d}+\frac {a^2 B \tan (c+d x)}{d}+\frac {2 a^2 C \tan (c+d x)}{d}+\frac {a^2 C \sec (c+d x) \tan (c+d x)}{2 d} \]
2*a^2*A*x + a^2*B*x + (a^2*A*ArcTanh[Sin[c + d*x]])/d + (2*a^2*B*ArcTanh[S in[c + d*x]])/d + (3*a^2*C*ArcTanh[Sin[c + d*x]])/(2*d) + (a^2*A*Sin[c + d *x])/d + (a^2*B*Tan[c + d*x])/d + (2*a^2*C*Tan[c + d*x])/d + (a^2*C*Sec[c + d*x]*Tan[c + d*x])/(2*d)
Time = 0.76 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.05, number of steps used = 11, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.256, Rules used = {3042, 4574, 3042, 4405, 3042, 4402, 3042, 4254, 24, 4257}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \cos (c+d x) (a \sec (c+d x)+a)^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a \csc \left (c+d x+\frac {\pi }{2}\right )+a\right )^2 \left (A+B \csc \left (c+d x+\frac {\pi }{2}\right )+C \csc \left (c+d x+\frac {\pi }{2}\right )^2\right )}{\csc \left (c+d x+\frac {\pi }{2}\right )}dx\) |
\(\Big \downarrow \) 4574 |
\(\displaystyle \frac {\int (\sec (c+d x) a+a)^2 (a (2 A+B)-a (2 A-C) \sec (c+d x))dx}{a}+\frac {A \sin (c+d x) (a \sec (c+d x)+a)^2}{d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \left (\csc \left (c+d x+\frac {\pi }{2}\right ) a+a\right )^2 \left (a (2 A+B)-a (2 A-C) \csc \left (c+d x+\frac {\pi }{2}\right )\right )dx}{a}+\frac {A \sin (c+d x) (a \sec (c+d x)+a)^2}{d}\) |
\(\Big \downarrow \) 4405 |
\(\displaystyle \frac {\frac {1}{2} \int (\sec (c+d x) a+a) \left (2 a^2 (2 A+B)-a^2 (2 A-2 B-3 C) \sec (c+d x)\right )dx-\frac {(2 A-C) \tan (c+d x) \left (a^3 \sec (c+d x)+a^3\right )}{2 d}}{a}+\frac {A \sin (c+d x) (a \sec (c+d x)+a)^2}{d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {1}{2} \int \left (\csc \left (c+d x+\frac {\pi }{2}\right ) a+a\right ) \left (2 a^2 (2 A+B)-a^2 (2 A-2 B-3 C) \csc \left (c+d x+\frac {\pi }{2}\right )\right )dx-\frac {(2 A-C) \tan (c+d x) \left (a^3 \sec (c+d x)+a^3\right )}{2 d}}{a}+\frac {A \sin (c+d x) (a \sec (c+d x)+a)^2}{d}\) |
\(\Big \downarrow \) 4402 |
\(\displaystyle \frac {\frac {1}{2} \left (-a^3 (2 A-2 B-3 C) \int \sec ^2(c+d x)dx+a^3 (2 A+4 B+3 C) \int \sec (c+d x)dx+2 a^3 x (2 A+B)\right )-\frac {(2 A-C) \tan (c+d x) \left (a^3 \sec (c+d x)+a^3\right )}{2 d}}{a}+\frac {A \sin (c+d x) (a \sec (c+d x)+a)^2}{d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {1}{2} \left (a^3 (2 A+4 B+3 C) \int \csc \left (c+d x+\frac {\pi }{2}\right )dx-a^3 (2 A-2 B-3 C) \int \csc \left (c+d x+\frac {\pi }{2}\right )^2dx+2 a^3 x (2 A+B)\right )-\frac {(2 A-C) \tan (c+d x) \left (a^3 \sec (c+d x)+a^3\right )}{2 d}}{a}+\frac {A \sin (c+d x) (a \sec (c+d x)+a)^2}{d}\) |
\(\Big \downarrow \) 4254 |
\(\displaystyle \frac {\frac {1}{2} \left (\frac {a^3 (2 A-2 B-3 C) \int 1d(-\tan (c+d x))}{d}+a^3 (2 A+4 B+3 C) \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+2 a^3 x (2 A+B)\right )-\frac {(2 A-C) \tan (c+d x) \left (a^3 \sec (c+d x)+a^3\right )}{2 d}}{a}+\frac {A \sin (c+d x) (a \sec (c+d x)+a)^2}{d}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle \frac {\frac {1}{2} \left (a^3 (2 A+4 B+3 C) \int \csc \left (c+d x+\frac {\pi }{2}\right )dx-\frac {a^3 (2 A-2 B-3 C) \tan (c+d x)}{d}+2 a^3 x (2 A+B)\right )-\frac {(2 A-C) \tan (c+d x) \left (a^3 \sec (c+d x)+a^3\right )}{2 d}}{a}+\frac {A \sin (c+d x) (a \sec (c+d x)+a)^2}{d}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle \frac {\frac {1}{2} \left (\frac {a^3 (2 A+4 B+3 C) \text {arctanh}(\sin (c+d x))}{d}-\frac {a^3 (2 A-2 B-3 C) \tan (c+d x)}{d}+2 a^3 x (2 A+B)\right )-\frac {(2 A-C) \tan (c+d x) \left (a^3 \sec (c+d x)+a^3\right )}{2 d}}{a}+\frac {A \sin (c+d x) (a \sec (c+d x)+a)^2}{d}\) |
(A*(a + a*Sec[c + d*x])^2*Sin[c + d*x])/d + (-1/2*((2*A - C)*(a^3 + a^3*Se c[c + d*x])*Tan[c + d*x])/d + (2*a^3*(2*A + B)*x + (a^3*(2*A + 4*B + 3*C)* ArcTanh[Sin[c + d*x]])/d - (a^3*(2*A - 2*B - 3*C)*Tan[c + d*x])/d)/2)/a
3.5.21.3.1 Defintions of rubi rules used
Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1) Subst[Int[Exp andIntegrand[(1 + x^2)^(n/2 - 1), x], x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))*(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_)), x_Symbol] :> Simp[a*c*x, x] + (Simp[b*d Int[Csc[e + f*x]^2, x], x ] + Simp[(b*c + a*d) Int[Csc[e + f*x], x], x]) /; FreeQ[{a, b, c, d, e, f }, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(d _.) + (c_)), x_Symbol] :> Simp[(-b)*d*Cot[e + f*x]*((a + b*Csc[e + f*x])^(m - 1)/(f*m)), x] + Simp[1/m Int[(a + b*Csc[e + f*x])^(m - 1)*Simp[a*c*m + (b*c*m + a*d*(2*m - 1))*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && GtQ[m, 1] && EqQ[a^2 - b^2, 0] && IntegerQ[2 *m]
Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_. ))*(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a _))^(m_), x_Symbol] :> Simp[A*Cot[e + f*x]*(a + b*Csc[e + f*x])^m*((d*Csc[e + f*x])^n/(f*n)), x] - Simp[1/(b*d*n) Int[(a + b*Csc[e + f*x])^m*(d*Csc[ e + f*x])^(n + 1)*Simp[a*A*m - b*B*n - b*(A*(m + n + 1) + C*n)*Csc[e + f*x] , x], x], x] /; FreeQ[{a, b, d, e, f, A, B, C, m}, x] && EqQ[a^2 - b^2, 0] && !LtQ[m, -2^(-1)] && (LtQ[n, -2^(-1)] || EqQ[m + n + 1, 0])
Time = 0.46 (sec) , antiderivative size = 155, normalized size of antiderivative = 1.28
method | result | size |
derivativedivides | \(\frac {a^{2} A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+B \,a^{2} \tan \left (d x +c \right )+C \,a^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+2 a^{2} A \left (d x +c \right )+2 B \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+2 C \,a^{2} \tan \left (d x +c \right )+a^{2} A \sin \left (d x +c \right )+B \,a^{2} \left (d x +c \right )+C \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) | \(155\) |
default | \(\frac {a^{2} A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+B \,a^{2} \tan \left (d x +c \right )+C \,a^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+2 a^{2} A \left (d x +c \right )+2 B \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+2 C \,a^{2} \tan \left (d x +c \right )+a^{2} A \sin \left (d x +c \right )+B \,a^{2} \left (d x +c \right )+C \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) | \(155\) |
parallelrisch | \(\frac {a^{2} \left (-2 \left (1+\cos \left (2 d x +2 c \right )\right ) \left (A +2 B +\frac {3 C}{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+2 \left (1+\cos \left (2 d x +2 c \right )\right ) \left (A +2 B +\frac {3 C}{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+4 x d \left (A +\frac {B}{2}\right ) \cos \left (2 d x +2 c \right )+\left (2 B +4 C \right ) \sin \left (2 d x +2 c \right )+A \sin \left (3 d x +3 c \right )+\sin \left (d x +c \right ) \left (A +2 C \right )+4 x d \left (A +\frac {B}{2}\right )\right )}{2 d \left (1+\cos \left (2 d x +2 c \right )\right )}\) | \(156\) |
risch | \(2 a^{2} A x +a^{2} B x -\frac {i a^{2} A \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i a^{2} A \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}-\frac {i a^{2} \left (C \,{\mathrm e}^{3 i \left (d x +c \right )}-2 B \,{\mathrm e}^{2 i \left (d x +c \right )}-4 C \,{\mathrm e}^{2 i \left (d x +c \right )}-C \,{\mathrm e}^{i \left (d x +c \right )}-2 B -4 C \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A}{d}-\frac {2 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B}{d}-\frac {3 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{2 d}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A}{d}+\frac {2 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B}{d}+\frac {3 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{2 d}\) | \(260\) |
norman | \(\frac {\left (-2 a^{2} A -B \,a^{2}\right ) x +\left (-4 a^{2} A -2 B \,a^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\left (2 a^{2} A +B \,a^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\left (4 a^{2} A +2 B \,a^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\frac {a^{2} \left (2 A -2 B -3 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{d}+\frac {a^{2} \left (2 B +3 C +6 A \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{d}-\frac {a^{2} \left (2 A +2 B +5 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {a^{2} \left (6 A -2 B -5 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{3}}-\frac {a^{2} \left (2 A +4 B +3 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {a^{2} \left (2 A +4 B +3 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) | \(298\) |
1/d*(a^2*A*ln(sec(d*x+c)+tan(d*x+c))+B*a^2*tan(d*x+c)+C*a^2*(1/2*sec(d*x+c )*tan(d*x+c)+1/2*ln(sec(d*x+c)+tan(d*x+c)))+2*a^2*A*(d*x+c)+2*B*a^2*ln(sec (d*x+c)+tan(d*x+c))+2*C*a^2*tan(d*x+c)+a^2*A*sin(d*x+c)+B*a^2*(d*x+c)+C*a^ 2*ln(sec(d*x+c)+tan(d*x+c)))
Time = 0.27 (sec) , antiderivative size = 143, normalized size of antiderivative = 1.18 \[ \int \cos (c+d x) (a+a \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {4 \, {\left (2 \, A + B\right )} a^{2} d x \cos \left (d x + c\right )^{2} + {\left (2 \, A + 4 \, B + 3 \, C\right )} a^{2} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (2 \, A + 4 \, B + 3 \, C\right )} a^{2} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (2 \, A a^{2} \cos \left (d x + c\right )^{2} + 2 \, {\left (B + 2 \, C\right )} a^{2} \cos \left (d x + c\right ) + C a^{2}\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \]
integrate(cos(d*x+c)*(a+a*sec(d*x+c))^2*(A+B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="fricas")
1/4*(4*(2*A + B)*a^2*d*x*cos(d*x + c)^2 + (2*A + 4*B + 3*C)*a^2*cos(d*x + c)^2*log(sin(d*x + c) + 1) - (2*A + 4*B + 3*C)*a^2*cos(d*x + c)^2*log(-sin (d*x + c) + 1) + 2*(2*A*a^2*cos(d*x + c)^2 + 2*(B + 2*C)*a^2*cos(d*x + c) + C*a^2)*sin(d*x + c))/(d*cos(d*x + c)^2)
\[ \int \cos (c+d x) (a+a \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=a^{2} \left (\int A \cos {\left (c + d x \right )}\, dx + \int 2 A \cos {\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int A \cos {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int B \cos {\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int 2 B \cos {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int B \cos {\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int C \cos {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int 2 C \cos {\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int C \cos {\left (c + d x \right )} \sec ^{4}{\left (c + d x \right )}\, dx\right ) \]
a**2*(Integral(A*cos(c + d*x), x) + Integral(2*A*cos(c + d*x)*sec(c + d*x) , x) + Integral(A*cos(c + d*x)*sec(c + d*x)**2, x) + Integral(B*cos(c + d* x)*sec(c + d*x), x) + Integral(2*B*cos(c + d*x)*sec(c + d*x)**2, x) + Inte gral(B*cos(c + d*x)*sec(c + d*x)**3, x) + Integral(C*cos(c + d*x)*sec(c + d*x)**2, x) + Integral(2*C*cos(c + d*x)*sec(c + d*x)**3, x) + Integral(C*c os(c + d*x)*sec(c + d*x)**4, x))
Time = 0.23 (sec) , antiderivative size = 192, normalized size of antiderivative = 1.59 \[ \int \cos (c+d x) (a+a \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {8 \, {\left (d x + c\right )} A a^{2} + 4 \, {\left (d x + c\right )} B a^{2} - C a^{2} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 2 \, A a^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 4 \, B a^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 2 \, C a^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 4 \, A a^{2} \sin \left (d x + c\right ) + 4 \, B a^{2} \tan \left (d x + c\right ) + 8 \, C a^{2} \tan \left (d x + c\right )}{4 \, d} \]
integrate(cos(d*x+c)*(a+a*sec(d*x+c))^2*(A+B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="maxima")
1/4*(8*(d*x + c)*A*a^2 + 4*(d*x + c)*B*a^2 - C*a^2*(2*sin(d*x + c)/(sin(d* x + c)^2 - 1) - log(sin(d*x + c) + 1) + log(sin(d*x + c) - 1)) + 2*A*a^2*( log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)) + 4*B*a^2*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)) + 2*C*a^2*(log(sin(d*x + c) + 1) - log(sin( d*x + c) - 1)) + 4*A*a^2*sin(d*x + c) + 4*B*a^2*tan(d*x + c) + 8*C*a^2*tan (d*x + c))/d
Time = 0.35 (sec) , antiderivative size = 204, normalized size of antiderivative = 1.69 \[ \int \cos (c+d x) (a+a \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {\frac {4 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1} + 2 \, {\left (2 \, A a^{2} + B a^{2}\right )} {\left (d x + c\right )} + {\left (2 \, A a^{2} + 4 \, B a^{2} + 3 \, C a^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (2 \, A a^{2} + 4 \, B a^{2} + 3 \, C a^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (2 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 3 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 5 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2}}}{2 \, d} \]
1/2*(4*A*a^2*tan(1/2*d*x + 1/2*c)/(tan(1/2*d*x + 1/2*c)^2 + 1) + 2*(2*A*a^ 2 + B*a^2)*(d*x + c) + (2*A*a^2 + 4*B*a^2 + 3*C*a^2)*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - (2*A*a^2 + 4*B*a^2 + 3*C*a^2)*log(abs(tan(1/2*d*x + 1/2*c) - 1)) - 2*(2*B*a^2*tan(1/2*d*x + 1/2*c)^3 + 3*C*a^2*tan(1/2*d*x + 1/2*c)^ 3 - 2*B*a^2*tan(1/2*d*x + 1/2*c) - 5*C*a^2*tan(1/2*d*x + 1/2*c))/(tan(1/2* d*x + 1/2*c)^2 - 1)^2)/d
Time = 16.98 (sec) , antiderivative size = 244, normalized size of antiderivative = 2.02 \[ \int \cos (c+d x) (a+a \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {\frac {A\,a^2\,\sin \left (3\,c+3\,d\,x\right )}{4}+\frac {B\,a^2\,\sin \left (2\,c+2\,d\,x\right )}{2}+C\,a^2\,\sin \left (2\,c+2\,d\,x\right )+\frac {A\,a^2\,\sin \left (c+d\,x\right )}{4}+\frac {C\,a^2\,\sin \left (c+d\,x\right )}{2}}{d\,\left (\frac {\cos \left (2\,c+2\,d\,x\right )}{2}+\frac {1}{2}\right )}-\frac {2\,\left (-2\,A\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )+A\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,1{}\mathrm {i}-B\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )+B\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,2{}\mathrm {i}+\frac {C\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,3{}\mathrm {i}}{2}\right )}{d} \]
((A*a^2*sin(3*c + 3*d*x))/4 + (B*a^2*sin(2*c + 2*d*x))/2 + C*a^2*sin(2*c + 2*d*x) + (A*a^2*sin(c + d*x))/4 + (C*a^2*sin(c + d*x))/2)/(d*(cos(2*c + 2 *d*x)/2 + 1/2)) - (2*(A*a^2*atan((sin(c/2 + (d*x)/2)*1i)/cos(c/2 + (d*x)/2 ))*1i - 2*A*a^2*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)) - B*a^2*atan(s in(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)) + B*a^2*atan((sin(c/2 + (d*x)/2)*1i) /cos(c/2 + (d*x)/2))*2i + (C*a^2*atan((sin(c/2 + (d*x)/2)*1i)/cos(c/2 + (d *x)/2))*3i)/2))/d